﻿using System.Collections.Generic;
using System.Linq;
using StoneAge.Infrastructure.Configuration;
using StoneAge.Models.Entity;

namespace StoneAge.DataContract.Extension
{
    public static class MapAreaExtensionMethod
    {
        public static string[] ConvertToSrc(this IEnumerable<MapArea> areas)
        {
            return areas.Select(a =>
            {
                return null == a ? string.Empty :
                    string.Format(ApplicationSettingsFactory.ApplicationSettings.MapAreaImageSrcFormat, a.MapId, a.X, a.Y);
            }).ToArray();
        }
    }
}
